SharedElementCallback

Listener provided in setEnterSharedElementCallback and setExitSharedElementCallback to monitor the Activity transitions. The events can be used to customize Activity Transition behavior.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
Listener to be called after onSharedElementsArrived when the shared elements are ready to be hidden in the source Activity and shown in the destination Activity.

Functions

Link copied to clipboard
open fun onCaptureSharedElementSnapshot(sharedElement: View, viewToGlobalMatrix: Matrix, screenBounds: RectF): Parcelable
Creates a snapshot of a shared element to be used by the remote Activity and reconstituted with onCreateSnapshotView.
Link copied to clipboard
open fun onCreateSnapshotView(context: Context, snapshot: Parcelable): View
Reconstitutes a snapshot View from a Parcelable returned in onCaptureSharedElementSnapshot to be used in onSharedElementStart and onSharedElementEnd.
Link copied to clipboard
open fun onMapSharedElements(names: List<String>, sharedElements: Map<String, View>)
Lets the SharedElementCallback adjust the mapping of shared element names to Views.
Link copied to clipboard
open fun onRejectSharedElements(rejectedSharedElements: List<View>)
Called after onMapSharedElements when transferring shared elements in.
Link copied to clipboard
open fun onSharedElementEnd(sharedElementNames: List<String>, sharedElements: List<View>, sharedElementSnapshots: List<View>)
In Activity Transitions, onSharedElementEnd is called immediately before capturing the end of the shared element state on enter and reenter transitions and immediately before capturing the start of the shared element state for exit and return transitions.
Link copied to clipboard
open fun onSharedElementsArrived(sharedElementNames: List<String>, sharedElements: List<View>, listener: SharedElementCallback.OnSharedElementsReadyListener)
Called during an Activity Transition when the shared elements have arrived at the final location and are ready to be transferred.
Link copied to clipboard
open fun onSharedElementStart(sharedElementNames: List<String>, sharedElements: List<View>, sharedElementSnapshots: List<View>)
In Activity Transitions, onSharedElementStart is called immediately before capturing the start of the shared element state on enter and reenter transitions and immediately before capturing the end of the shared element state for exit and return transitions.